<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="__PUBLIC__/Js/jquery.js"></script>
</head>
<body>

<div id="content" style="border:1px solid red;height:400px;overflow:auto;">

</div>

<select name="uid">
	<option value="1">Lucy</option>
	<option value="2">Jack</option>
	<option value="3">Tom</option>

</select>
<input type="text" name="content"> 

<select name="resid">
	<option value="4">admin</option>
	
	
</select>

<input type="text" value="0" name="count">

<input type="button" name="load" value="load">

<input type="submit" name="send" value="发送">

<script>

$('[name="load"]').click(function(){

	var count = $('[name="count"]').val();
	$.get('<{:U("query")}>',{count:count},function(data){

		$('[name="count"]').val(data.count);
		if(data.success){
			$('[name="load"]').click();
				var html = ''; 
			$(data.rows).map(function(k,v){
				html += '<p>'+v.content+'</p>'
			});

			$('#content').html(html);
		}else{
			$('[name="load"]').click();
		}		

	},'json');

});

$('[name="load"]').click();

$('[name="send"]').click(function(){
	var content = $('[name="content"]').val();
	var uid = $('[name="uid"]').val();
	var resid = $('[name="resid"]').val();


	$('[name="content"]').val('');

	$.post('<{:U("add")}>',{content:content,uid:uid,resid:resid});

});










</script>
	
</body>
</html>